package com.woniuxy.springboottest.config;

import com.woniuxy.springboottest.bean.UserBean;
import com.woniuxy.springboottest.mapper.UserMapper;
import com.woniuxy.springboottest.service.impl.UserServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author linke
 * @version 1.0
 * @className: CustomConfig
 * @description: 类的方式 配置
 * @date 2021/11/16 17:38
 */
/*
@Configuration   //加入IOC容器、告知spring boot这是一个配置类  作用与spring配置文件一样
public class CustomConfig {

    @Bean  //<bean>  默认用方法名作为bean的id
    public UserBean getUser(){
        return new UserBean(10,"10",null,null);
    }

    @Bean
    public UserMapper userMapper(){
        return new UserMapper();
    }

    @Bean
    public UserServiceImpl userServiceImpl(UserMapper userMapper){
        return new UserServiceImpl(userMapper);
    }
}
*/
